//
// Created by Administrator on 2023/7/30.
//
#include <iostream>

using namespace std;

class Solution {
public:
    int commonFactors(int a, int b) {
        int count = 0;
        for (int i = 1; i <= min(a, b) ; ++i) {
            if (a % i ==0 && b % i == 0){
                count++;
                //cout << i << endl;
            }
        }
        return count;
    }
};

int main() {
    Solution s;
    cout << s.commonFactors(12, 6) << endl;
    cout << s.commonFactors(25, 30) << endl;
}
